
 
import { cache_key_arg0, cache_return } from "utils/decorate/decorate";
import { roomCostStrategy } from "./BaseCostStrategy"
 
export class roomCostStrategyOfSafe extends roomCostStrategy
{
    @cache_return("cache",0,cache_key_arg0)
    public getCost(roomName:string):CostMatrix
    {
        const room = Game.rooms[roomName]
        const station = global.world.PollBlueplan(roomName);
        if(station && room.IsMy())
        {   // 安全寻路一定时我自己的房间
            const cost =  station.getSafeMatrix();
            const rams = room.getStructures(STRUCTURE_RAMPART);
            rams.forEach(e=>
                {
                    cost.set(e.pos.x,e.pos.y,1);
                })
        }
       
        let tmpcosts =  new PathFinder.CostMatrix()
        return tmpcosts;
         
    }
}
